package com.wc.alorithm_luogu.P5726;

import java.util.Scanner;

/**
 * @Author congge
 * @Date 2023/4/20 13:13
 * @description https://www.luogu.com.cn/problem/P5726
 * 打分
 */
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();

        int max = -1;
        int min = 11;

        int point;

        int sum = 0;

        int people = n;
        while (n-- > 0) {
            point = sc.nextInt();
            max = Math.max(max, point);
            min = Math.min(min, point);
            sum += point;
        }

        sum = sum - max - min;
        double avg = sum * 1.0 / (people - 2);
        System.out.printf("%.2f", avg);
    }
}
